//
//  VideoListItemCell.swift
//  maopu
//
//  Created by 黄海波 on 2017/4/1.
//  Copyright © 2017年 maopu. All rights reserved.
//

import UIKit

class VideoListItemCell: UITableViewCell , CommentToolbarViewDelegate{
    
    @IBOutlet var headerImg:UIButton!
    @IBOutlet var userNameLab:UILabel!
    @IBOutlet var posterIco:UILabel! //楼主
    @IBOutlet var rankLab:UILabel! //等级
    @IBOutlet var sexImg:UIImageView!  //性别
    @IBOutlet var timeLab:UILabel!  //时间
    @IBOutlet var contentLB:UILabel!
    @IBOutlet var commentToolbarView:CommentToolbarView!
    
    @IBOutlet var collectionView:UICollectionView!
    @IBOutlet var collectionView_height:NSLayoutConstraint!
    @IBOutlet var collectionView_width:NSLayoutConstraint!
    
    fileprivate var lineView:UIView!
//    fileprivate var message = ""
//    var tapGesture:UITapGestureRecognizer!
    
    fileprivate var doubleClickBtn:UIButton!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        self.contentLB.font = UIFont.LightDefaultFont(18)
        self.contentLB.textColor = UIColor.m_textDeepColor()
        self.contentLB.lineBreakMode = .byCharWrapping
        self.contentLB.numberOfLines = 0
        self.contentLB.text = "跨越自己狠简单特别简单的一件事情只要想去做的话"
        
        self.userNameLab.font = UIFont.LightDefaultFont(14)
        self.userNameLab.textColor = UIColor.m_textDeepColor()
        
        self.posterIco.textAlignment = .center
        self.posterIco.layer.masksToBounds = true
        self.posterIco.layer.cornerRadius = 6
        self.posterIco.backgroundColor = UIColor.m_landlordBgColor()
        self.posterIco.textColor = UIColor.m_landlordTextColor()
        self.posterIco.font = UIFont.LightDefaultFont(10)
        
        self.rankLab.textAlignment = .center
        self.rankLab.layer.masksToBounds = true
        self.rankLab.layer.cornerRadius = 6
        self.rankLab.backgroundColor = UIColor.m_rankBgColor()
        self.rankLab.textColor = UIColor.m_rankTextColor()
        self.rankLab.font = UIFont.LightDefaultFont(10)
        self.rankLab.text = "  神经猫  "
        
        self.headerImg.setTitle("", for: UIControlState())
        self.headerImg.setImage(UIImage.init(named: "test_header"), for: UIControlState())
        self.headerImg.layer.masksToBounds = true
        self.headerImg.layer.cornerRadius = 15
        
        self.timeLab.font = UIFont.LightDefaultFont(11)
        self.timeLab.textColor = UIColor.RGB(r: 136, g: 136, b: 136)
        self.timeLab.text = "今天 15: 00"
        
        self.collectionView.backgroundColor = UIColor.blue
        
        self.lineView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: AppWidth, height: 1))
        self.lineView.backgroundColor = UIColor.m_lineColor()
        self.contentView.addSubview(self.lineView)
        self.lineView.snp.remakeConstraints { (make) in
            make.height.equalTo(1)
            make.left.equalTo(self)
            make.right.equalTo(self)
            make.bottom.equalTo(self)
        }
        
        commentToolbarView.delegate = self
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
    }
    
    func refreshCellData(message:String ){
        self.contentView.layoutIfNeeded()
        
    }
    
    func commentToolbarView(commentToolbarView: CommentToolbarView, didSelectButton button: UIButton, type: UpvoteViewType) {
        
    }
   
    
}
